from random import randint
import time

n = int(input())

print 'n=%d'%(n)

data = []
for i in range(n):
    data.append(randint(0,n*n))

print 'bubble sort start !!!'
# print data
print 'running...'

t1 = int(time.time()*1000)

for i in range(n):
    for j in range(1,n):
        if data[j-1]>data[j]:
            data[j-1]^=data[j]
            data[j]^=data[j-1]
            data[j-1]^=data[j]

t2 = int(time.time()*1000)

print 'bubble sort end !!!'
# print data

p = True
for i in range(1,n):
    if data[i-1]>data[i]:
        p = False
        break

print 'the answer of bubble sort is '+('right' if p else 'wrong')+' !!!'
print 'run time: %dms'%(t2-t1)
